package verificationCode;

public class verificationCode {
    public static void main(String[] args)
    {
        System.out.println(GetCode(4));
    }
    public static String GetCode(int n)
    {
        String code = "";
        for(int i = 0;i < n;i++)
        {
            int num = (int)(Math.random()*3);
            switch(num)
            {
                case 0:
                    code+=(String)((int)(Math.random()*10));
                    break;
                case 1:
                    code+=(char)((int)(Math.random()*26)+65);
                    break;
                case 2:
                    code+=(char)((int)(Math.random()*26)+97);
                    break;
            }
        }
        return code;
    }
}
